class StatisticsController < ApplicationController

  before_filter :check_admin, :except => [:list]

	def index
		@tutors = Attendee.tutors
		@n_shirts = Attendee.shirts_total
		@n_attendees = Attendee.total
		@n_lodge = Attendee.lodge_total
    	@n_paid = Attendee.paid_total
    	@n_paid_lodge = Attendee.paid_lodge_total
    	@n_gds = (0..9).map { |i| Attendee.gd_attendees(i) }
    	@gd_attendees = (0..9).map { |i| Attendee.attendees_gd(i) }
    	@n_queue = Attendee.queue_total
    	@areas = (0..7).map { |i| Attendee.find_all_by_area(i) }
	end

	def list
	  @list = case params[:tipo]
        when "alojamento" then Attendee.lodge
        when "fila" then Attendee.queue
    end
  end
end
